import axios from "axios"

// eslint-disable-next-line
export default {
    get:({curPage,eachPage})=>{
      return  axios.get('/api/students', {
            params: {
                curPage,
                eachPage
            }
          })
          .then(({data})=>data)
    },
    
    addStu:(data)=>{
    return  axios.post('/api/students/addstu', data)
      .then((response)=> response.data)
    },
    selectStudent:(name)=>{
      return  axios.get('/api/students/selectName', {
            params: {
               name:name
            }
          })
          .then(({data})=>data)
    },
    delStudent:(_id)=>{
      return  axios.post('/api/students/delstu', {         
              _id
          })
          .then(({data})=>data)
    },
    findeOne:(data)=>{
      return  axios.post('/api/students/findOne', data)
    .then(({data})=>data)

    },
    reviseStu:({_id,data})=>{
      return  axios.patch(`/api/students/${_id}`, data)
    .then(({data})=>data)

    },
    
    
    
}  